<?php

namespace Ensao\AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class PaiementType extends AbstractType
{

    public function buildForm(FormBuilder $builder, array $options)
    {

        $builder
            ->add('dateOperation', 'date', array('widget' => 'single_text',
                                                'input'=>'datetime',
                                                'format' => 'yyyy-MM-dd',
                                                'invalid_message' => 'La date est invalide',
                                               // 'error_bubbling'  => true
                                                )
                )
            ->add('montant','number',array(  'invalid_message' => 'Le montant est invalide',
                                           // 'error_bubbling'  => true
                                          )
                )
            ->add('observation','textarea',array(  'invalid_message' => 'L\'observation est invalide',
                                              //'error_bubbling'  => true
                                                )
                 )
        ;
    }
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Ensao\AppBundle\Entity\Paiement',
        ));
    }

    public function getName()
    {
        return 'paiement';
    }
}
